<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 200px;
            height: 200px;
            background-color: red;
            position: relative;
            /* 父元素相对定位不设置偏移量 */
        }

        .box img {
            width: 100%;
            height: 100%;
        }

        .son {
            width: 50px;
            height: 50px;
            background-color: yellow;
            /* 子元素绝对定位 永远对于父元素来定位 */
            position: absolute;
            top: 80px;
            left: 80px;

        }

        .big {
            width: 1000px;
            height: 800px;
            background-color: black;
            margin: 0 auto;
            position: relative;
        }

        .big img {
            width: 100%;
            height: 100%;
        }

        .left {
            width: 200px;
            height: 600px;
            background-color: green;
            position: absolute;
            top: 100px;
            left: 15px;

        }

        .top {
            width: 80%;
            height: 30px;
            background-color: pink;
            position: absolute;
            top: 5px;
            left: 100px;
        }

        .box1 {
            width: 100px;
            height: 30px;
            background-color: blue;
            float: left;
        }

        .box2 {
            width: 100px;
            height: 30px;
            background-color: yellowgreen;
            float: right;
        }

        .bottom {
            width: 400px;
            height: 200px;
            background-color: aqua;
            position: absolute;
            bottom: 25px;
            right: 10px;
        }
    </style>
</head>

<body>

    H<sub>2</sub>O
    x<sup>2</sup>


    XXX<sup><img src="imgs/1.png" width="10px" height="10px"></sup>

    <div class="box">
        <img src="imgs/a.jpg">
        <div class="son" style="display: none;">
        </div>

    </div>

    <!-- 模拟腾讯视屏的定位 -->
    <div class="big">
        <img src="imgs/a.jpg">
        <!-- 左边块 -->
        <div class="left"></div>
        <!-- 上边块 -->
        <div class="top">
            <div class="box1"></div>
            <div class="box2"></div>
        </div>
        <!-- 下边快 -->
        <div class="bottom"></div>
    </div>

</body>

</html>
<script>
    document.querySelector(".box").onmouseover = function () {
        // alert(111);
        document.querySelector(".son").style.display = "block";
    }
    document.querySelector(".box").onmouseout = function () {
        // alert(111);
        document.querySelector(".son").style.display = "none";
    }
</script>